![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
The partridge clutch class. More...
#include <Partridge_All.h>
Public Member Functions | |
virtual void | Dying () |
Generic dying handler. More... | |
void | OnStartIncubating () |
Flag under incubation. More... | |
virtual void | BeginStep (void) |
Clutch BeginStep. More... | |
virtual void | Step (void) |
ClutchStep. More... | |
virtual void | EndStep (void) |
Clutch EndStep. More... | |
virtual bool | DailyMortality () |
Background mortality test. More... | |
virtual bool | OnFarmEvent (FarmToDo event) |
Handle farm event. More... | |
void | AgDying () |
Killed by management. More... | |
void | OnEaten () |
Message handler. More... | |
void | OnGivenUp () |
Message handler. More... | |
void | OnMumDead () |
Message handler. More... | |
void | SetClutchSize (int cs) |
Set no. eggs. More... | |
int | GetClutchSize (void) |
Supply no eggs. More... | |
Partridge_Female * | GetMother (void) |
Supply mother pointer. More... | |
Partridge_Clutch (int a_x, int a_y, Partridge_Female *a_mother, Partridge_Covey *a_flock, Landscape *a_map, int a_num_eggs, int a_family_counter, Partridge_Population_Manager *a_manager) | |
Constructor. More... | |
virtual | ~Partridge_Clutch (void) |
Destructor. More... | |
![]() | |
Partridge_Object | GetObjectType () |
Supply object type. More... | |
bool | GetUncleStatus () |
Supply uncle status. More... | |
void | SetUncleStatus (bool a_Status) |
Set uncle status. More... | |
bool | PossibleMate (Partridge_Base *a_partridge) |
Can we mate? More... | |
virtual bool | ArePaired () |
Overridden base function. More... | |
Partridge_Covey * | GetCovey (void) |
Supply covey pointer. More... | |
Partridge_State | GetState (void) |
Supply state. More... | |
void | SetState (Partridge_State a_pars) |
Set state. More... | |
int | GetFamily (void) |
Supply family ID. More... | |
int | GetAge (void) |
Supply age. More... | |
void | SetAge (int a_age) |
Set age. More... | |
long | GetID (void) |
Supply ID. More... | |
void | SetFamily (unsigned int family) |
Set family ID. More... | |
void | SetCovey (Partridge_Covey *a_covey) |
Set covey pointer. More... | |
void | MakeCovey () |
Create our own covey. More... | |
void | SwitchCovey (Partridge_Covey *a_covey) |
Swap coveys. More... | |
Partridge_Base (int a_born_x, int a_born_y, int a_x, int a_y, int a_family_counter, Partridge_Covey *a_covey, Landscape *a_map, Partridge_Population_Manager *a_manager) | |
Constructor for Partridge_Base. More... | |
virtual | ~Partridge_Base (void) |
Destructor. More... | |
virtual void | CopyMyself (int a_Ptype) |
Duplicate this object. More... | |
![]() | |
unsigned | SupplyFarmOwnerRef () |
AnimalPosition | SupplyPosition () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
virtual void | KillThis () |
virtual void | CopyMyself () |
void | SetX (int a_x) |
void | SetY (int a_y) |
TAnimal (int x, int y, Landscape *L) | |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual int | WhatState () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
![]() | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
Private Member Functions | |
Partridge_State | ClDeveloping (void) |
Development state. More... | |
void | ClDying (void) |
Dying state. More... | |
Private Attributes | |
int | m_clutch_size |
No. of eggs. More... | |
Partridge_Female * | m_mother |
Pointer to mother. More... | |
bool | m_underincubation |
Are we being incubated? More... | |
Additional Inherited Members | |
![]() | |
Partridge_Population_Manager * | m_OurPopulationManager |
Pointer to the population manager. More... | |
![]() | |
virtual void | CheckMatePointers () |
Debug. More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
![]() | |
int | m_signal |
Used to pass information to outputs. More... | |
long | m_id |
Individual bird ID. More... | |
int | m_family_counter |
Family ID. More... | |
int | m_age |
Age in days. More... | |
int | m_born_x |
x-coord of birth More... | |
int | m_born_y |
y-coord of birth More... | |
bool | m_UncleStatus |
If has uncle status in the covey. More... | |
Partridge_Object | m_object_type |
Type of pob object this is. More... | |
Partridge_Covey * | m_covey |
Pointer to the covey. More... | |
Partridge_State | m_state |
Current behavioural state. More... | |
![]() | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
![]() | |
int | m_CurrentStateNo |
The basic state number for all objects - '-1' indicates death. More... | |
bool | m_StepDone |
Indicates whether the iterative step code is done for this timestep. More... | |
The partridge clutch class.
Partridge_Clutch::Partridge_Clutch | ( | int | a_born_x, |
int | a_born_y, | ||
Partridge_Female * | a_mother, | ||
Partridge_Covey * | a_covey, | ||
Landscape * | a_map, | ||
int | a_num_eggs, | ||
int | a_family_counter, | ||
Partridge_Population_Manager * | a_manager | ||
) |
Constructor.
The constructor. Ensures sensible values for attributes not set by the base constructor.
References m_clutch_size, m_mother, Partridge_Base::m_object_type, m_underincubation, and pob_Clutch.
void Partridge_Clutch::AgDying | ( | ) |
Killed by management.
This controls behaviour on the death of a clutch due to management. If the clutch is hit there is a very good chance that the hen dies too, so need to tell her.
References ClDying(), population_attributes::incNoAgDeadClutches(), population_attributes::incNoClutchesPredated(), PartridgeCommunicationData::m_clutch, Partridge_Population_Manager::m_comms_data, PartridgeCommunicationData::m_female, Partridge_Population_Manager::m_messagecentre, m_mother, Partridge_Population_Manager::m_Ourkfactors, Partridge_Base::m_OurPopulationManager, k_factors::m_ThisYear, Partridge_Communication::PassMessage(), and pcomm_ClutchMown.
Referenced by OnFarmEvent().
|
virtual |
Clutch BeginStep.
Does nothing more than check bacground mortalities and management mortalities.
Reimplemented from TAnimal.
References TAnimal::CheckManagement(), ClDying(), and DailyMortality().
|
private |
Development state.
This method controls the development of the clutch and its hatching. Hatching occurs when the clutch has been incubated for a predefined period.
Timing: Occurs at the end of a day (e.g. midnight-1 minute). Must create Clutch_Size number of Partridge_Chick Objects. They tell their mother that they have been created when they exist in the system.
References Partridge_Population_Manager::AddHatchSuccess(), Partridge_struct::bx, Partridge_struct::by, cfg_par_incubation_period, cfg_par_infertile_eggs, Partridge_Population_Manager::CreateObjects(), Partridge_struct::family_counter, g_rand_uni, Partridge_Female::GetMate(), Partridge_Base::m_age, PartridgeCommunicationData::m_clutch, m_clutch_size, Partridge_Population_Manager::m_comms_data, Partridge_struct::m_covey, Partridge_Base::m_covey, TALMaSSObject::m_CurrentStateNo, Partridge_Base::m_family_counter, PartridgeCommunicationData::m_female, TAnimal::m_Location_x, TAnimal::m_Location_y, PartridgeCommunicationData::m_male, Partridge_Population_Manager::m_messagecentre, m_mother, Partridge_Base::m_OurPopulationManager, TALMaSSObject::m_StepDone, m_underincubation, Chick_struct::Mum, Partridge_Covey::NestLeave(), pars_ClDeveloping, pars_Destroy, Partridge_Communication::PassMessage(), pcomm_AllInfertile, pcomm_EggsHatch, pob_Chick, Partridge_Covey::RemoveMember(), CfgInt::value(), CfgFloat::value(), Partridge_struct::x, and Partridge_struct::y.
Referenced by EndStep().
|
private |
Dying state.
Removes the clutch from the system after doing any necessary house-keeping.
References population_attributes::incNoDeadClutches(), Partridge_Base::m_covey, TALMaSSObject::m_CurrentStateNo, m_mother, Partridge_Population_Manager::m_Ourkfactors, Partridge_Base::m_OurPopulationManager, Partridge_Base::m_state, TALMaSSObject::m_StepDone, k_factors::m_ThisYear, pars_Destroy, and Partridge_Covey::RemoveMember().
Referenced by AgDying(), BeginStep(), Dying(), OnEaten(), OnGivenUp(), and OnMumDead().
|
virtual |
Background mortality test.
No functionality any longer because this is done in the female incubtation due to the need to have density-dependence calculated first.
Reimplemented from Partridge_Base.
Referenced by BeginStep().
|
inlinevirtual |
|
virtual |
Clutch EndStep.
Does the development for the clutch here.
Reimplemented from TAnimal.
References ClDeveloping(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, Partridge_Base::m_state, pars_ClDeveloping, pars_ClDying, pars_ClHatching, pars_Destroy, and Landscape::Warn().
|
inline |
|
inline |
void Partridge_Clutch::OnEaten | ( | void | ) |
Message handler.
Response to a pcomm_ClutchEaten
References ClDying(), and m_mother.
Referenced by Partridge_Communication::PassMessage().
|
virtual |
Handle farm event.
Chooses the response to external management events. Responses can either be set via config variables or directly here.
Reimplemented from TAnimal.
References AgDying(), autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, burn_straw_stubble, cattle_out, cattle_out_low, cfg_par_cl_cut, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_greenmanure, fa_manure, fa_npk, fa_pk, fa_sludge, fa_slurry, fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_sludge, fp_slurry, fungicide_treat, g_rand_uni, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, herbicide_treat, hilling_up, insecticide_treat, TAnimal::m_OurLandscape, Partridge_Base::m_state, molluscicide, mow, pars_Destroy, pigs_out, product_treat, row_cultivation, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, straw_chopping, strigling, strigling_sow, stubble_harrowing, swathing, syninsecticide_treat, CfgFloat::value(), Landscape::Warn(), water, and winter_plough.
void Partridge_Clutch::OnGivenUp | ( | void | ) |
Message handler.
Called as a direct call from Partridge_Female::OnMateDying
References ClDying(), and m_mother.
Referenced by Partridge_Female::OnMateDying().
void Partridge_Clutch::OnMumDead | ( | void | ) |
|
inline |
|
inline |
|
virtual |
ClutchStep.
Does little here except initiating behaviour and ensuring m_StepDone is true on death.
Reimplemented from TAnimal.
References Partridge_Base::CheckMatePointers(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, Partridge_Base::m_state, TALMaSSObject::m_StepDone, pars_ClDeveloping, pars_ClDying, pars_ClHatching, pars_Destroy, pars_Initiation, and Landscape::Warn().
|
private |
No. of eggs.
Referenced by ClDeveloping(), GetClutchSize(), Partridge_Clutch(), and SetClutchSize().
|
private |
Pointer to mother.
Referenced by AgDying(), ClDeveloping(), ClDying(), GetMother(), OnEaten(), OnGivenUp(), OnMumDead(), and Partridge_Clutch().
|
private |
Are we being incubated?
Referenced by ClDeveloping(), OnStartIncubating(), and Partridge_Clutch().